From: Matthew Flaschen Date: Tue, 17 May 2016 14:18:58 +0000 (-0400) Subject: Title->getContentModel: Get new content model with GAID_FOR_UPDATE X-Git-Tag: 1.31.0-rc.0~6933^2 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=dc579d27da7b86ff46dc972eb54ea31cba561c26;p=lhc%2Fweb%2Fwiklou.git Title->getContentModel: Get new content model with GAID_FOR_UPDATE If a new revision has been inserted (e.g. with updateRevisionOn), the content model may have changed. This happens with e.g. undeletion. Bug: T122262 Change-Id: Ia0ed86a9c24809256215418673e9ee8e263d1349 --- diff --git a/includes/Title.php b/includes/Title.php index 25fbce3f57..72c21fc337 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -908,7 +908,9 @@ class Title implements LinkTarget { * @return string Content model id */ public function getContentModel( $flags = 0 ) { - if ( !$this->mContentModel && $this->getArticleID( $flags ) ) { + if ( ( !$this->mContentModel || $flags === Title::GAID_FOR_UPDATE ) && + $this->getArticleID( $flags ) + ) { $linkCache = LinkCache::singleton(); $linkCache->addLinkObj( $this ); # in case we already had an article ID $this->mContentModel = $linkCache->getGoodLinkFieldObj( $this, 'model' );